﻿// Decompiled with JetBrains decompiler
// Type: DnProcessSimulateCommands.PlayFromThisLocation.CUiStartFromThisLocationCmd
// Assembly: DnProcessSimulateCommands, Version=2402.0.0.890, Culture=neutral, PublicKeyToken=null
// MVID: A885D881-AEDF-447E-852A-6F13102E089C
// Assembly location: C:\Program Files\Tecnomatix_2402\eMPower\DotNetCommands\DnProcessSimulateCommands.dll

using System.Resources;
using Tecnomatix.Engineering;
using Tecnomatix.Engineering.Ui;


namespace DnProcessSimulateCommands.PlayFromThisLocation;

public class CUiStartFromThisLocationCmd : TxButtonCommand
{
  private CApStartFromThisLocationEnabler m_enabler;
  private CApStartFromThisLocationApp m_app;

  public CUiStartFromThisLocationCmd()
  {
    this.m_enabler = new CApStartFromThisLocationEnabler();
    this.m_app = new CApStartFromThisLocationApp();
  }

  public virtual string Category
  {
    get => this.GetResourceManager().GetString("PLAY_FROM_THIS_LOCATION_CMD_CATEGORY");
  }

  public virtual string Name
  {
    get => this.GetResourceManager().GetString("PLAY_FROM_THIS_LOCATION_CMD_NAME");
  }

  public virtual string Bitmap => "PlayFromThisLocation.playFromThisLocation.bmp";

  public virtual string Tooltip
  {
    get => this.GetResourceManager().GetString("PLAY_FROM_THIS_LOCATION_CMD_TOOLTIP");
  }

  public virtual string Description
  {
    get => this.GetResourceManager().GetString("PLAY_FROM_THIS_LOCATION_CMD_DESCRIPTION");
  }

  private ResourceManager GetResourceManager()
  {
    return new ResourceManager("DnProcessSimulateCommands.StringTable", ((object) this).GetType().Assembly);
  }

  public virtual ITxCommandEnabler CommandEnabler => (ITxCommandEnabler) this.m_enabler;

  public virtual void Execute(object cmdParams)
  {
    if (!this.m_enabler.Enable)
      return;
    this.m_app = new CApStartFromThisLocationApp();
    this.m_app.PlayFromSelectedLocation();
  }

  public virtual ITxImage Image => (ITxImage) TxImageManager.GetImageByKey("PlayFromThisLocation");
}
